import Vue from 'vue'
import App from './App.vue'
import router from "@/router";
import '@/mock/mockServer.js'
import 'swiper/css/swiper.css'
import TypeNav from '@/components/TypeNav'
import SwiperLoop from "@/components/SwiperLoop";
import Pagination from '@/components/Pagination'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/plugins/velidate.js'
//import '@/api'//测试接口用的
//import {reqCategoryList} from "@/api";
// import { MessageBox,Message} from 'element-ui';
// Vue.prototype.$msgbox = MessageBox;
// Vue.prototype.$alert = MessageBox.alert;
// Vue.prototype.$confirm = MessageBox.confirm;
// Vue.prototype.$message = Message;
import * as API from '@/api'
import store from "@/store";
import VueLazyload from 'vue-lazyload'
import loading from '@/assets/images/rabbit.jpg'
// 在图片界面没有进入到可视范围前不加载, 在没有得到图片前先显示loading图片
Vue.use(VueLazyload, { // 内部自定义了一个指令lazy
  loading,  // 指定未加载得到图片之前的loading图片
})
//reqCategoryList()
Vue.config.productionTip = false
Vue.component('TypeNav',TypeNav)//第一种方式
//Vue.component(TypeNav.name,TypeNav)第二种方式
Vue.component('SwiperLoop',SwiperLoop)
Vue.component('Pagination',Pagination)
Vue.use(ElementUI);
new Vue({
  beforeCreate() {
    Vue.prototype.$bus=this
    Vue.prototype.$API=API
  },
  render: h => h(App),
  router,//每个组件都可以通过this.$router获取到路由器对象，通过this.$route获取到路由对象
  store//每个组件通过this.$store获取到store对象
}).$mount('#app')